import { post } from '@/core/utils/http';
import type { Response, ShopConfigType, PageConfigType, RecordType } from '@/core/models';

/**  获取APP版本 */
export const queryAppVersions = () : Promise<Response<ShopConfigType>> => {
	return post('Api/Common/GetAppVersions');
}

/**  获取项目配置 */
export const queryShopConfigV2 = () : Promise<Response<ShopConfigType>> => {
	return post('Api/Common/GetConfigV2');
}

/**  查询首页配置 */
export const queryPageConfig = (data : { code : string }) : Promise<Response<PageConfigType>> => {
	return post('Api/Page/GetPageConfig', {
		data,
	});
}

/**  获取日志 */
export const queryRecord = (data : any) : Promise<Response<RecordType>> => {
	return post('Api/Page/GetRecord', {
		data,
	});
}

/**  获取订阅模板 */
export const getSubscriptionTmplIds = () : Promise<Response<any>> => {
	return post('Api/WeChatAppletsMessage/Tmpl', {}, true);
}